<?php
$p				= $func->html_get('p');
$type			= 1;
if($p=='' && !$news_class->isInt($p)){
	$p = 1;
}
$p 				= floor($p);
$num			= $config_var->WEB_ITEMS;
$MaxP			= $config_var->WEB_PAGE;
$min			= $num*($p-1);
$i				= 0;

$RowNews		= $news_class->GetByAll($num, $min, $type, 1);
$CountRow		= $news_class->CountByAll($type);
?>
<div class="conter_top db">
	<?php include 'application/view/default/flash.php';?>
</div><!--end conter_top-->

<div class="main db">
	<div class="main_left dib">
    	<div class="page db">
        	<div class="page_title icon_tt db"><span><?php echo $config_nc->News;?></span></div>
            <div class="page_content db">
            	<ul class="page_hotel db">
                	<?php
                    $count = count($RowNews); 
                    for($i=0;$i<$count;$i++){ 
						$RowDetail	= $news_detail_class->GetByIdNews(1, 0, $RowNews[$i]['id_news'], $WEB_LANGUAGE);
						if(is_array($RowDetail)){
					?>
                	<li>
                    	<a href="<?php echo $WEB_DOMAIN;?>/?u1=news-detail&u2=<?php echo $RowNews[$i]['id_news'];?>">
                    		<img class="thumb f-left" src="<?php echo $RowNews[$i]['image'];?>" alt="<?php echo $RowDetail[0]['title'];?>">
                        </a>
                        <div class="hotel_right db">
                        	<h3><?php echo $RowDetail[0]['title'];?></h3>
                            <?php echo trim($func->DisplayWord($RowDetail[0]['content'],50));?>
                            <a class="xemthem" href="<?php echo $WEB_DOMAIN;?>/?u1=news-detail&u2=<?php echo $RowNews[$i]['id_news'];?>">Chi tiết</a>
                        </div>
                    </li>
                    <?php
						}
					}
					?>
                </ul><!--end page_hotel-->
                <div class="paging right db">
                	<?php		
					$RowPT = $func->GetPageNom($CountRow,$num,$MaxP,$p);
					if(is_array($RowPT) && count($RowPT)>0){
						$Links  = $WEB_DOMAIN.'/?u1=hotel';				
						foreach($RowPT as $k => $v){	
							if($v==$p){
                        		echo '<a class="active">'.$v.'</a>';
                        	}else{ 
                        		echo '<a href="'.$Links.'&p='.$v.'">'.$v.'</a>';
                        	}
                    	} 
					}
					?>
                </div><!--end paging-->
            </div><!--end page_content-->
        </div><!--end page-->
    </div><!--end main_left-->
    <div class="main_right dib"><span>
    	<?php include 'application/view/template/right.php';?>
    </span></div>
</div><!--end main-->
